import instacne from "../request";

/**
 *  1退货申请处理表格数据   /returnApply/list
 *  查询
 */
interface IReturnApplyParams {
  createTime?: string;
  handleMan?: string;
  id?: number;
  pageNum?: number;
  pageSize?: number;
  receiverKeyword?: string;
  status?: number;
  handleTime?: string;
}
interface IReturnApplyItem {
  companyAddressId: number;
  createTime: string;
  description: string;
  handleMan: string;
  handleNote: string;
  handleTime: string;
  id: number;
  memberUsername: string;
  orderId: number;
  orderSn: string;
  productAttr: string;
  productBrand: string;
  productCount: number;
  productId: number;
  productName: string;
  productPic: string;
  productPrice: number;
  productRealPrice: number;
  proofPics: string;
  reason: string;
  receiveMan: string;
  receiveNote: string;
  receiveTime: string;
  returnAmount: number;
  returnName: string;
  returnPhone: string;
  status: number;
}
interface IReturnApplyRes {
  list: IReturnApplyItem[];
  pageNum: number;
  pageSize: number;
  total: number;
  totalPage: number;
}
const returnApply1 = (data?: IReturnApplyParams): Promise<IReturnApplyRes> => {
  return instacne.get("/returnApply/list", {
    params: data,
  });
};

/**
 *  2退货申请处理查看详情   /returnApply/4
 *  查询
 */
const returnDetail = (data: IReturnApplyParams) => {
  return instacne.get(`/returnApply/${data.id}`, data);
};

/**
 *  批量删除
 */
const returnDel = (data: number) => {
  return instacne.post(`/returnApply/delete?ids=${data}`);
};

export { returnApply1, returnDetail, returnDel };
export type { IReturnApplyItem, IReturnApplyRes, IReturnApplyParams };
